import java.awt.*;
import java.awt.geom.AffineTransform;

public class Tortue extends Dessinable
{
	private Point p1;
	@SuppressWarnings("unused")
	public double orientation;
	
	public Tortue(Point p1, int cap)
	{
		this.p1 = p1;
		this.orientation = cap;
	
	}	
	
	public void dessiner(Graphics2D g)  
	{	
		dessineImage(g,orientation,p1.x,p1.y,Logo.Iturtle,0.3);
	}
	
	public void dessineImage(Graphics2D g,double orientation,int x,int y, Image img,double scale)
	{
		double width,height;
		width = img.getWidth(null) * scale;
		height = img.getHeight(null) * scale;
		g.rotate(((double)(orientation* 2.0 * java.lang.Math.PI / 360.0)), x+(width/2),y+(height/2));
		g.drawImage(img,(int)(x),(int)(y),(int)width,(int)height,null);
		g.rotate(((double)((360-orientation)* 2.0 * java.lang.Math.PI / 360.0)),x,y);	
	}

}